import axios from 'axios'

axios.defaults.headers.common['authorization'] = "Bearer "+localStorage.getItem('token')

//获取订单列表
export function orders() {
  return axios.get('http://api.cat-shop.penkuoer.com/api/v1/orders');
}
//订单提交
export function getorders(model) {
  console.log(model)
  return axios.post('http://api.cat-shop.penkuoer.com/api/v1/orders',model);

}

//根据id删除订单详情
export function delorders(id) {
  return axios.delete('http://api.cat-shop.penkuoer.com/api/v1/orders/'+id);
}

//根据id获取订单详情
export function getidorders(id) {
  return axios.get('http://api.cat-shop.penkuoer.com/api/v1/orders/'+id);
}
